‘Rocket Launcher ‘—————————————————— ‘Setup Section ‘—————————————————— dim x,y,z,count,count2,dur,snd RCSTA=0 configio 0,1,2,3,4,5,6,7,8,9,13,14 setio 0,1,2,3,4,5,6,7,8,9 clearall pullupon if inp12 = 0 then signal 14,40,200 setio end endif ‘—————————————————- ‘Arming section ‘—————————————————- arm: onportgoto 11,-,clipoff setio 0,1,2,3,4,5,6,7,8,9 snd = 40 : dur = 20 : gosub beep onportgoto 12,launch,- goto arm clipoff: setio 0,9 snd=250 : dur = 3 : gosub beep goto arm beep: count = count + 1 if count = 255 then count2 = count2 + 1 count = 0 endif if count2 = 10 then signal 14,dur,snd count2 = 0 endif return ‘—————————————————- ‘Launch sequence ‘—————————————————- launch: low 10 for x = 9 to 1 step -1 high x onportgoto 12,-,abort onportgoto 11,-,error y = x * 2 +40 signal 14,60,y low x onportgoto 12,-,abort onportgoto 11,-,error longpause 250,2 low x next for x = 1 to 10 high 0 signal 14,10,20 low 0 signal 14,10,10 next high 13 goto rearm ‘———————————————- ‘Error Handlers ‘———————————————- error: for y = 1 to 20 high x signal 14,5,150 low x signal 14,5,160 next goto rearm abort: for y = 1 to 20 high x signal 14,10,40 low x signal 14,10,45 next rearm: onportgoto 12,rearm,- low 13 end